package org.example.managere.entity.feibiao;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 电机基础信息实体类 - 电机向量知识库
 */
@Entity
@Table(name = "am_knowledge_basic")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AmKnowledgeBasic {
    @Id
    @Column(name = "motor_id", length = 10, nullable = false)
    private String motorId;
    
    @Column(name = "motor_type", length = 50, nullable = false)
    private String motorType;
    
    @Column(name = "manufacturer", length = 100, nullable = false)
    private String manufacturer;
    
    @Column(name = "rated_power", precision = 10, scale = 2, nullable = false)
    private BigDecimal ratedPower;
    
    @Column(name = "rated_voltage", precision = 10, scale = 2, nullable = false)
    private BigDecimal ratedVoltage;
    
    @Column(name = "rated_current", precision = 10, scale = 2, nullable = false)
    private BigDecimal ratedCurrent;
    
    @Column(name = "info_update_time", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date infoUpdateTime;
    
    @PrePersist
    @PreUpdate
    public void updateTimestamp() {
        this.infoUpdateTime = new Date();
    }
} 